<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add Event</title>

    <style type="text/css">
    </style>
</head>
<body>
<f:view>
<h:messages errorStyle="color: #ff0000" globalOnly="false"/>
    
    <h:form id="eventForm">

        <%-- The existingItemId is used on updating an existing item --%>
        <table>
            <tr><td colspan="2">Enter Event details below</td></tr>
            <tr><td>Name:</td>
                <td>
                    <h:inputText id="Name" required="true" value="#{eventHandler.name}" />
                    <h:message for="name" style="color: #ff0000" />
                </td></tr>
            <tr><td>Description (optional):</td><td><h:inputText id="Description" value="#{eventHandler.description}"  /></td></tr>
            <tr><td>Start Date:<br>e.g.: 01/01/2009</td><td><h:inputText id="StartDate" required="true" value="#{eventHandler.startDate}">
              <f:convertDateTime type="date" pattern="MM/dd/yyyy" timeZone="America/Chicago" /></h:inputText>
              </td></tr>
            <tr><td>End Date:<br>e.g.: 01/01/2009</td><td><h:inputText id="EndDate" required="true" value="#{eventHandler.endDate}">
            <f:convertDateTime type="date" pattern="MM/dd/yyyy" timeZone="America/Chicago" /></h:inputText>
            </td></tr>
            <tr><td>Start Time:<br>e.g.: 11:45 AM</td><td><h:inputText id="StartTime" required="true" value="#{eventHandler.startTime}" >
            <f:convertDateTime type="time" timeStyle="short" timeZone="America/Chicago" /></h:inputText>
            </td></tr>
            <tr><td>End Time:<br>e.g.: 2:45 PM</td><td><h:inputText id="EndTime" required="true" value="#{eventHandler.endTime}" >
            <f:convertDateTime type="time" timeStyle="short" timeZone="America/Chicago" /></h:inputText>
            </td></tr>
            <tr><td colspan="2">
                <h:commandButton value="#{'Add'}" action="#{eventHandler.createNew}" />
            </td></tr>
            <tr><td><a href="myEvents.jsf">Back to My Events</a></td></tr>
        </table>
    </h:form>
</f:view>
</body>
</html>